USE [LAFDC]
GO
/****** Object:  StoredProcedure [dbo].[spGetSTATUS_byPrevID]    Script Date: 11/23/2009 23:02:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Ludovic FERRE
-- Create date: 2007-08-31
-- Description:	Retrieve adherent status by prev_id
-- =============================================
CREATE PROCEDURE [dbo].[spGetSTATUS_byPrevID]
	@PREV_ID nvarchar(255)
AS
BEGIN
	SET NOCOUNT ON;

		select AD, SECTION, RETENU, RUB2, INDICE_RETRAITE, OTIG, DATE_ADHESION, AFFECTATION
		  from adherent adh
		  join divers div
			on adh.prev_id = div.prev_id
		 where adh.prev_id = @PREV_ID

END
